package com.kfm.springboot.controller;

import cn.hutool.core.util.IdUtil;
import com.kfm.springboot.domain.SysUser;
import com.kfm.springboot.util.UUIDUtils;
import org.springframework.web.bind.annotation.*;

@RestController
//@CrossOrigin(origins = "http://127.0.0.1:5500")
public class TestController {

    @RequestMapping(value = "/test", method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT})
    public SysUser test(String username, String password, @RequestBody SysUser sysUser){
        sysUser.setId(UUIDUtils.createUUID32());
        sysUser.setTimer(IdUtil.getSnowflakeNextId());
        System.out.println(sysUser.getTimer());
        return sysUser;
    }
}
